<ul id="header_links" style="margin-top: 0px">
  <li>
    <a class="<?php echo $this->router->fetch_class() == 'index' && $this->router->fetch_method() == 'index'?'active':''?>"
	   href="<?php echo site_url('index')?>">Home</a>
  </li>
  <?php $categories = $this->category_model->get_all(array('parent_id' => 0));
  foreach($categories as $category){
?>
  <li><a class="<?php echo isset($parent_id) && $parent_id==$category['id']?'active':''?>" 
         href="<?php echo site_url('index/category/'.$category['id'].'/'.str_nice_name($category['name']))?>">
      <?php echo $category['name'] ?></a></li>
  <?php } ?>
</ul>